import { EntitySchema } from '@mikro-orm/core';

export class LeGoodsService {
  id!: string;
  title!: string;
  content?: string;
  sort: number = 1;
  status: boolean = true;
  merchantId!: string;
  AppID!: string;
  createdTime!: string;
  updatedTime?: string;
  deletedTime?: string;
  isDeleted: boolean = false;
}

export const LeGoodsServiceSchema = new EntitySchema({
  class: LeGoodsService,
  properties: {
    id: { primary: true, type: 'string', columnType: 'bigint' },
    title: { type: 'string', length: 50 },
    content: { type: 'string', length: 255, nullable: true },
    sort: { type: 'number', columnType: 'smallint', default: 1 },
    status: { type: 'boolean', default: true },
    merchantId: { type: 'string', columnType: 'bigint' },
    AppID: { type: 'string', fieldName: 'AppID', length: 50 },
    createdTime: { type: 'string', columnType: 'bigint' },
    updatedTime: { type: 'string', columnType: 'bigint', nullable: true },
    deletedTime: { type: 'string', columnType: 'bigint', nullable: true },
    isDeleted: { type: 'boolean', default: false },
  },
});
